package dk.aiszone.lang.sql.interfaces;

import dk.aiszone.lang.sql.SQLField;
import dk.aiszone.lang.sql.SQLOr;

/**
 * Common interface between object which supports fields and constrains.
 * 
 * @author ads
 */
public interface SQLFieldConstraintObject {

    /**
     * Add a <code>SQLConstraint</code> to the <code>SQLFieldConstraintObject</code> object.
     * 
     * @param constraint
     *            The <code>SQLConstraint</code> to use in the join statement.
     */
    public abstract void addConstraint(SQLConstraint constraint);

    /**
     * Add a <code>SQLOr</code> to the <code>SQLFieldConstraintObject</code> object.
     * 
     * @param or
     *            The <code>SQLOr</code> to use in the join statement.
     */
    public abstract void addConstraint(SQLOr or);

    /**
     * Add a field to the to the <code>SQLFieldConstraintObject</code> object.<br>
     * Fields added to this object, will automatically be added to the select statement of the final<br>
     * <code>SQLObject</code>.<br>
     * This will allow the user in a simple way, at runtime, to added or remove joins from the SQL statement.
     * 
     * @param field
     *            The <code>SQLField</code> to select from the joined table.
     */
    public abstract void addField(SQLField field);

    /**
     * Add a join operation to the <code>SQLFieldConstraintObject</code> object.
     * 
     * @param join
     *            New join operation to add.
     */
    public abstract void addJoin(SQLJoin join);
}
